package com.huarui.task.dao;

import java.util.HashMap;
import java.util.Map;

import org.ewaf.framework.dao.impl.BaseDaoImpl;

import com.huarui.task.model.Task;

public class TaskDao extends BaseDaoImpl{

	
	public Task  getTaskById(Integer id , boolean forUpdate){
		
		Map<String , Object> params = new HashMap<String, Object>();
		params.put("id", id);
		params.put("forUpdate", Boolean.valueOf(forUpdate));
		
		
		return (Task) getSqlMapClientTemplate().queryForObject(namespace + ".queryById",params);
		
	}
	
	public Task getTaskByWkFlIdAndTableId(Map<String, Object> paramsMap) {
		return (Task) this.getSqlMapClientTemplate().queryForObject(super.namespace + ".getTaskByWkFlIdAndTableId", paramsMap);
	}
	
	public boolean updateCurrentor(Map<String, Object> paramsMap) {
		return 1 == this.getSqlMapClientTemplate().update(super.namespace + ".updateCurrentor", paramsMap);
	}
	
	public boolean updateOrders(Map<String, Object> paramsMap) {
		 return 1 == this.getSqlMapClientTemplate().update(super.namespace + ".updateOrders", paramsMap);
	}
}
